---
layout: "default"
title: "String.UnicodeScalarView.Generator"
description: "Swift documentation for 'String.UnicodeScalarView.Generator': A type whose instances can produce the elements of this
sequence, in order."
keywords: "String.UnicodeScalarView.Generator,struct,swift,documentation,next"
root: "/v2.1"
---

<div class="intro-declaration"><code class="language-swift">struct String.UnicodeScalarView.Generator</code></div>

<div class="discussion comment">
    <p>A type whose instances can produce the elements of this
sequence, in order.</p>
</div>

<table class="standard">
<tr>
<th id="inheritance">Inheritance</th>
<td>
<code class="inherits">GeneratorType</code>
<span class="viz"><a href="hierarchy/">View Protocol Hierarchy &rarr;</a></span>
</td>
</tr>



<tr>
<th>Import</th>
<td><code class="language-swift">import Swift</code></td>
</tr>

</table>







<h3>Instance Methods</h3>
<div class="declaration" id="func-next">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-next">mutating func next()</a>
        
<div class="comment collapse" id="comment-func-next"><div class="p">
    <p>Advance to the next element and return it, or <code>nil</code> if no next
element exists.</p>

<p><strong>Requires:</strong> No preceding call to <code>self.next()</code> has returned
  <code>nil</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">mutating func next() -&gt; UnicodeScalar?</code>
    
    
</div></div>
</div>


